package reit.ass3;


/**
 * The Class MyStringBuilder, builds string with StringBuilder.
 */
class MyStringBuilder {
	
	/** The string builder. */
	private StringBuilder fStringBuilder;
	
	/**
	 * Instantiates a new my string builder.
	 *
	 * @param startString the start string
	 */
	public MyStringBuilder(final String startString){
		fStringBuilder = new StringBuilder(startString);
	}
	
	/**
	 * Append string.
	 *
	 * @param appendedString the appended string
	 * @return the string
	 */
	public String appendString(final String appendedString){
		this.fStringBuilder.append(appendedString);
		return this.getString();
	}
	
	/**
	 * Gets the string.
	 *
	 * @return the string
	 */
	public String getString(){
		return this.fStringBuilder.toString();
	}

	/**
	 * Builds the string.
	 *
	 * @param strings the strings
	 * @return the unified string
	 */
	public static String buildString(final String... strings) {
		StringBuilder tStringBuilder = new StringBuilder();
		for (String arg : strings) {
			tStringBuilder.append(arg);
		}
		return tStringBuilder.toString();
	}
}
